package com.github.baichuan.application.scaffold.rest.dto.role;

import com.github.baichuan.mapping.Mapping;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

@Schema(title = "角色表单")
@Getter
@Setter
public class RoleForm {

    @Schema(title = "角色名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "角色名称不能为空")
    @Size(max = 16, message = "角色名称最多16个字符")
    @Mapping
    private String name;

    @Schema(title = "角色代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @Size(max = 16, message = "角色代码最多16个字符")
    @Mapping
    private String code;

    @Schema(title = "角色描述")
    @Size(max = 32, message = "角色描述最多32个字符")
    @Mapping
    private String intro;
}
